<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    userId:<input type="number" v-model="userId"><br/>
    message:<input type="text" v-model="msg"><br/>
     反馈：<label>{{ data }}</label><br/>
    <button @click="sendMessage">发送</button>
    <br/>
</div>
<script src="./js/axios.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    let v = new Vue({
        el: "#app",
        data: {
            userId: '',
            msg: '',
            data: ''
        },
        methods: { // 注意这里是 methods，不是 method
            sendMessage() {
                axios.get("http://localhost:8082/test/" + this.userId + "/" + this.msg).then((res) => {
                    this.data = res.data
                })
            }
        },
    })
</script>
</body>
</html>
